Skip to content

fix(text): avoid mutating accessibilityState - #58318

Closed
mfkrause wants to merge 2 commits into
react:mainfrom
mfkrause:fix/text-accessibility-state-mutation
Closed

fix(text): avoid mutating accessibilityState#58318
mfkrause wants to merge 2 commits into
react:mainfrom
mfkrause:fix/text-accessibility-state-mutation

Conversation

@mfkrause

@mfkrause mfkrause commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Summary:

When accessibilityState.disabled conflicts with an explicit disabled prop, the Text component currently updates accessibilityState in place. This mutates an object owned by the caller, which can cause issues when other code uses that same object.

This fix creates a new object instead, while retaining existing behavior (giving priority to the explicit prop).

Changelog:

[GENERAL] [FIXED] - Prevent Text from mutating the accessibilityState prop

Test Plan:

Unchanged tests pass + added a regression test

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Sep 3, 2026
@facebook-github-tools facebook-github-tools Bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Sep 3, 2026
@meta-codesync

meta-codesync Bot commented Sep 4, 2026

Copy link
Copy Markdown

@javache has imported this pull request. If you are a Meta employee, you can view this in D118788803.

@meta-codesync meta-codesync Bot closed this in c300f84 Sep 4, 2026
@meta-codesync meta-codesync Bot added the Merged This PR has been merged. label Sep 4, 2026
@meta-codesync

meta-codesync Bot commented Sep 4, 2026

Copy link
Copy Markdown

@javache merged this pull request in c300f84.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant